function testConnection(data) {
    if ($.validate.form()) {
        var config = {
            url: ctx + "datamonitor/database/testConnection",
            type: "post",
            dataType: "json",
            data: data,
            beforeSend: function () {
                $.modal.loading("正在连接中，请稍候...");
                $.modal.disable();
            },
            success: function(result) {
                if (result.code == 0) {
                    $.modal.msgSuccess(result.msg)
                } else if (result.code == 301) {
                    $.modal.alertWarning(result.msg);
                }  else {
                    $.modal.alertError(result.msg);
                }
                $.modal.closeLoading();
            }
        };
        $.ajax(config)
    }
}